'\" te
.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 2019 Peter Tribble
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH FMSTAT 8 "Aug 26, 2019"
.SH NAME
fmstat \- report fault management module statistics
.SH SYNOPSIS
.nf
\fBfmstat\fR [\fB-astTz\fR] [\fB-d\fR u | d ] [\fB-m\fR \fImodule\fR] [\fIinterval\fR [\fIcount\fR]]
.fi

.SH DESCRIPTION
The \fBfmstat\fR utility can be used by administrators and service personnel to
report statistics associated with the Fault Manager, \fBfmd\fR(8) and
its associated set of modules. The Fault Manager runs in the background on each
system. It receives telemetry information relating to problems detected
by the system software, diagnoses these problems, and initiates proactive
self-healing activities such as disabling faulty components.
.sp
.LP
You can use \fBfmstat\fR to view statistics for diagnosis engines and agents
that are currently participating in fault management. The documentation for
\fBfmd\fR(8), \fBfmadm\fR(8), and \fBfmdump\fR(8) describes more about tools
to observe fault management activities.
.sp
.LP
If the \fB-m\fR option is present or the \fB-t\fR option is present,
\fBfmstat\fR reports any statistics kept by the specified fault management
module. The module list can be obtained using \fBfmadm config\fR.
.sp
.LP
If the \fB-m\fR option is not present, \fBfmstat\fR reports the following
statistics for each of its client modules:
.sp
.ne 2
.na
\fB\fBmodule\fR\fR
.ad
.RS 11n
The name of the fault management module, as reported by \fBfmadm config\fR.
.RE

.sp
.ne 2
.na
\fB\fBev_recv\fR\fR
.ad
.RS 11n
The number of telemetry events received by the module.
.RE

.sp
.ne 2
.na
\fB\fBev_acpt\fR\fR
.ad
.RS 11n
The number of events accepted by the module as relevant to a diagnosis.
.RE

.sp
.ne 2
.na
\fB\fBwait\fR\fR
.ad
.RS 11n
The average number of telemetry events waiting to be examined by the module.
.RE

.sp
.ne 2
.na
\fB\fBsvc_t\fR\fR
.ad
.RS 11n
The average service time for telemetry events received by the module, in
milliseconds.
.RE

.sp
.ne 2
.na
\fB\fB%w\fR\fR
.ad
.RS 11n
The percentage of time that there were telemetry events waiting to be examined
by the module.
.RE

.sp
.ne 2
.na
\fB\fB%b\fR\fR
.ad
.RS 11n
The percentage of time that the module was busy processing telemetry events.
.RE

.sp
.ne 2
.na
\fB\fBopen\fR\fR
.ad
.RS 11n
The number of active cases (open problem investigations) owned by the module.
.RE

.sp
.ne 2
.na
\fB\fBsolve\fR\fR
.ad
.RS 11n
The total number of cases solved by this module since it was loaded.
.RE

.sp
.ne 2
.na
\fB\fBmemsz\fR\fR
.ad
.RS 11n
The amount of dynamic memory currently allocated by this module.
.RE

.sp
.ne 2
.na
\fB\fBbufsz\fR\fR
.ad
.RS 11n
The amount of persistent buffer space currently allocated by this module.
.RE

.sp
.LP
The \fBfmstat\fR utility requires the user to possess the \fBPRIV_SYS_ADMIN\fR
privilege. See \fBprivileges\fR(7).
.SH OPTIONS
The following options are supported:
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.RS 13n
Print all statistics for a module, including those kept on its behalf by
\fBfmd\fR. If the \fB-a\fR option is not present, only those statistics kept by
the module are reported. If the \fB-a\fR option is used without the \fB-m\fR
\fImodule\fR, a set of global statistics associated with \fBfmd\fR are
displayed.
.RE

.sp
.ne 2
.na
\fB\fB-d\fR \fBu\fR | \fBd\fR\fR
.ad
.RS 13n
Display a time stamp.
.sp
Specify \fBu\fR for a printed representation of the internal representation of
time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See
\fBdate\fR(1).
.RE

.sp
.ne 2
.na
\fB\fB-m\fR \fImodule\fR\fR
.ad
.RS 13n
Print a report on the statistics associated with the specified fault management
module, instead of the default statistics report. Modules can publish an
arbitrary set of statistics to help Sun service the fault management software
itself. The module statistics constitute a Private interface. See
\fBattributes\fR(7) for information on Sun's rules for Private interfaces.
Scripts should not be written that depend upon the values of fault management
module statistics as they can change without notice.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR\fR
.ad
.RS 13n
Print a report on Soft Error Rate Discrimination (SERD) engines associated with
the module instead of the default module statistics report. A SERD engine is a
construct used by fault management software to determine if a statistical
threshold measured as \fIN\fR events in some time \fIT\fR has been exceeded.
The \fB-s\fR option can only be used in combination with the \fB-m\fR option.
.RE

.sp
.ne 2
.na
\fB\fB-t\fR\fR
.ad
.RS 13n
Print a report on the statistics associated with each fault management event
transport. Each fault management module can provide the implementation of one
or more event transports.
.RE

.sp
.ne 2
.na
\fB\fB-T\fR\fR
.ad
.RS 13n
Print a table of the authority information associated with each fault
management event transport. If the \fB-m\fR option is present, only transports
associated with the specified module are displayed.
.RE

.sp
.ne 2
.na
\fB\fB-z\fR\fR
.ad
.RS 13n
Omit statistics with a zero value from the report associated with the specified
fault management module. The \fB-z\fR option can only be used in combination
with the \fB-m\fR option.
.RE

.SH OPERANDS
The following operands are supported:
.sp
.ne 2
.na
\fB\fIcount\fR\fR
.ad
.RS 12n
Print only count reports, and then exit.
.RE

.sp
.ne 2
.na
\fB\fIinterval\fR\fR
.ad
.RS 12n
Print a new report every \fIinterval\fR seconds.
.RE

.sp
.LP
If no \fIinterval\fR and no \fIcount\fR are specified, a single report is
printed and \fBfmstat\fR exits. If an \fIinterval\fR is specified but no
\fIcount\fR is specified, \fBfmstat\fR prints reports every \fIinterval\fR
seconds indefinitely until the command is interrupted.
.SH EXIT STATUS
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 5n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.RS 5n
A fatal error occurred. A fatal error could be the failure to communicate with
\fBfmd\fR(8). It could also be that insufficient privileges were available to
perform the requested operation.
.RE

.sp
.ne 2
.na
\fB\fB2\fR\fR
.ad
.RS 5n
Invalid command-line options were specified.
.RE

.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	See below.
.TE

.sp
.LP
The command-line options are Evolving. The human-readable default report is
Unstable. The human-readable module report is Private.
.SH SEE ALSO
.BR attributes (7),
.BR privileges (7),
.BR fmadm (8),
.BR fmd (8),
.BR fmdump (8)
